﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Equation.Enterprise.Framework.ApplicationServices;

namespace ENail.Domain.Core.Contract.Services
{
    public interface IVendorService : IApplicationService
    {
        /// <summary>
        /// Helps view all vendors on list view
        /// </summary>
        /// <returns>List of all vendors</returns>
        IList<Vendor> GetAllVendors();

        /// <summary>
        /// Helps view vendors for search view
        /// </summary>
        /// <param name="where">Lambda condition to get vendors</param>
        /// <returns></returns>
        IList<Vendor> GetVendors(Expression<Func<Vendor, bool>> where);


        /// <summary>
        /// Helps view details of an vendor
        /// </summary>
        /// <param name="id">Identity of vendor</param>
        /// <returns>Vendor with specified identity</returns>
        Vendor GetVendor(int id);

        /// <summary>
        /// Insert an vendor from view
        /// </summary>
        /// <param name="vendor">Vendor to be inserted</param>
        /// <returns>Number of records affected</returns>
        int InsertVendor(Vendor vendor);

        /// <summary>
        /// Update an vendor from view
        /// </summary>
        /// <param name="vendor">Vendor to be updated</param>
        /// <returns>Number of records affected</returns>
        int UpdateVendor(Vendor vendor);

        /// <summary>
        /// Helps view active vendors only
        /// </summary>
        /// <returns>All active vendors</returns>
        IList<Vendor> GetAllActiveVendors();

        /// <summary>
        /// Helps to inactive an vendor
        /// </summary>
        /// <param name="vendor">Vendor to be inactive</param>
        /// <returns>Number of records affected</returns>
        int InActiveVendor(Vendor vendor);
    }
}
